//
//  BYClassificationHeader.m
//  OCDemo
//
//  Created by zhumuzhi on 2022/2/13.
//

#import "BYClassificationHeader.h"

@interface BYClassificationHeader ()

@property (nonatomic, strong) UILabel *title;

@end


@implementation BYClassificationHeader

#pragma mark - SetData
- (void)setData:(NSDictionary *)data {
    _data = data;
    _title.text = SafeStr(data[@"sectionTitle"]);
}

#pragma mark - CellHeight
+ (CGFloat)CellHeight {
    return kAutoWithSize(40);
}

#pragma mark - Init

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self addSubview:self.title];
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    [self.title mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self);
        
    }];
}

- (UILabel *)title {
    if (!_title) {
        _title = [[UILabel alloc] init];
    }
    return _title;
}


@end
